import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Login from '../pages/Login/index';
import Register from '../pages/Register/index';
import Dashboard from '../pages/Dashboard/index';
import BasicLayout from '../layouts/BasicLayout';
import BlogArticles from '../pages/blog/articles/index';
import AddArticle from '../pages/blog/articles/AddArticle';
import EditArticle from '../pages/blog/articles/EditArticle';

const AppRouter = () => {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Login />} />
        <Route path="/login" element={<Login />} />
        <Route path="/register" element={<Register />} />
        <Route element={<BasicLayout />}>
          <Route path="/dashboard" element={<Dashboard />} />
          <Route path="/user" element={<div>用户管理</div>} />
          <Route path="/permission" element={<div>权限管理</div>} />
          <Route path="/blog/articles" element={<BlogArticles />} />
          <Route path="/blog/articles/add" element={<AddArticle />} />
          <Route path="/blog/articles/edit/:id" element={<EditArticle />} />
        </Route>
      </Routes>
    </Router>
  );
};

export default AppRouter;